package com.aizuda.boot.modules.business.department.domain.response;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

/**
 * @Author sangyirong
 * @ClassName EmploveePermissionVO
 * @Version 1.0
 * @Date 2025/6/14 17:05
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "员工权限信息")
public class EmployeePermissionVO {

    @Schema(description = "员工id")
    private Long employeeId;

    @Schema(description = "员工名称")
    private String name;

    @Schema(description = "员工别名")
    private String aliasName;

    @Schema(description = "员工头像")
    private String avatar;

    @Schema(description = "部门id")
    private Long deptId;

    @Schema(description = "部门名称")
    private String deptName;

    @Schema(description = "租户id")
    private String tenantKey;

    @Schema(description = "租户名称")
    private String tenantName;

    @Schema(description = "员工权限信息")
    private List<OwnPermissionVO> ownPermission;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class OwnPermissionVO {

        @Schema(description = "员工id")
        private Long employeeId;

        @Schema(description = "员工名称")
        private String name;

        @Schema(description = "员工别名")
        private String aliasName;

        @Schema(description = "员工头像")
        private String avatar;

        @Schema(description = "部门id")
        private Long deptId;

        @Schema(description = "部门名称")
        private String deptName;

        @Schema(description = "角色信息")
        private List<RoleVo> roles;

        @Schema(description = "租户id")
        private String tenantKey;

        @Schema(description = "租户名称")
        private String tenantName;

        @Schema(description = "权限信息")
        private List<PermissionVO> permissions;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class RoleVo {

        @Schema(description = "角色id")
        private Integer roleId;

        @Schema(description = "角色名称")
        private String roleName;

        @Schema(description = "角色权限信息")
        private Map<String,String> rolePermissions;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class PermissionVO {

        @Schema(description = "权限id")
        private Integer permissionId;

        @Schema(description = "权限名称")
        private String permissionName;
    }
}
